<template>
  <div>
    <div class="banner_img">
<!--      <template>-->
        <el-carousel indicator-position="outside">
          <el-carousel-item v-for="item in 4" :key="item">
            <h3>{{ item }}</h3>
          </el-carousel-item>
        </el-carousel>
<!--      </template>-->
    </div>
    <div class="view" id="login_continue">
      <el-form :model="loginForm" label-width="70px" :rules="loginRules" ref="loginForm">
        <el-form-item label="用户名" prop="username">
          <el-input v-model="loginForm.username"></el-input>
        </el-form-item>
      </el-form>
      <el-form label-width="70px">
        <el-form-item label="密码" prop="password">
          <el-input v-model="loginForm.password" show-password></el-input>
        </el-form-item>
      </el-form>
      <div style="width: 300px;height: 40px" class="div-code-position">
        <el-form class="el-form-code" label-width="70px">
          <el-form-item label="验证码" prop="code">
            <el-input class="validation_code" v-model="loginForm.code"></el-input>
          </el-form-item>
          <img class="validation_code_img" src="@/assets/image/bmob.png">
        </el-form>
      </div>
      <el-button class="login_btn_action" type="primary" @click="loginAction">登录</el-button>
      <el-button class="registerd_btn" type="text" @click="registerdAction">注册</el-button>
      <el-button class="forget_btn" type="text" @click="forgetAction">忘记密码</el-button>
    </div>
  </div>


</template>

<script>
  export default {
    name: "Login",
    created() {
      console.log('111111111111111111111111111')
    },
    data() {
      return {
        //这是登录表单的数据绑定对象
        loginForm: {
          username: 'admin',
          password: '312',
          code: 'bmob'
        },
        //这是表单的验证规则对象
        loginRules: {
          username: [{required: true, message: '请输入邮箱地址', trigger: 'blur'},
            {type: 'email', message: '请输入正确的邮箱地址', trigger: ['blur', 'change']}
          ],
          password: [{required: true, message: '请输入活动名称', trigger: 'blur'},
            {min: 8, max: 16, message: '长度在 6 到 16 个字符', trigger: 'blur'}],
          code: [{required: true, message: '验证码不能为空', trigger: 'blur'},
            {min: 4, max: 6, message: '长度在 4 到 6 个字符', trigger: 'blur'}]
        }
      };

    },
    methods: {
      loginAction() {
        // this.$router.push("/home")
        this.$router.push("/createJoinOrganization")

        console.log(1)
      },
      registerdAction() {
        this.$router.push("/registered")
        console.log(2)
      },
      forgetAction() {
        this.$router.push("/forgetPassword")
        console.log(3)
      }
    }

  }
</script>

<style scoped>

  .banner_img{
    float: left;
    width: 500px;
    height: 340px;
    margin:130px 0 0 130px;
}

  .el-carousel__item h3 {
    color: #475669;
    font-size: 14px;
    opacity: 0.75;
    line-height: 300px;
    margin: 0;
  }

  .el-carousel__item:nth-child(2n) {
    background-color: #99a9bf;
  }

  .el-carousel__item:nth-child(2n+1) {
    background-color: #d3dce6;
  }

  #login_continue {
    float: right;
    border: 1px solid white;
    background-color: white;
    margin-top: 130px;
    margin-right: 20px;
    border-radius: 25px;
    width: 320px;
    height: 340px;

  }
  .el-form {
    margin-top: 35px;
    margin-right: 30px;
  }

  .validation_code {
    float: right;
    /*padding: 5px 40px ;*/
    /*margin-right: 100px;*/
  }

  .div-code-position {
    position: relative;
  }

  .el-form-code {
    /*position: relative;*/
    width: 200px;

  }

  .validation_code_img {
    position: absolute;
    top: 10px;
    right: 15px;
    float: right;
    width: 80px;
  }

  .login_btn_action {
    float: right;
    padding: 10px 97px;
    margin-top: 23px;
    margin-left: 30px;
    margin-right: 26px;
  }

  .forget_btn {
    float: right;
    margin-right: 26px;
  }

  .registerd_btn {
    float: left;
    margin-left: 70px;
  }
</style>
